import { createRequestTypes } from '@UTILS/reduxHelper'

export const GET_MY_PATIENTS = createRequestTypes('GET_MY_PATIENTS')
export const GET_MY_PATIENTS_AND_REGISTRATION_STATUS = createRequestTypes('GET_MY_PATIENTS_AND_REGISTRATION_STATUS')
export const GET_PATIENT_RELATIONSHIP = createRequestTypes('GET_PATIENT_RELATIONSHIP')
export const GET_PATIENT_BY_ID = createRequestTypes('GET_PATIENT_BY_ID')
export const SAVE_PATIENT = createRequestTypes('SAVE_PATIENT')
export const REGISTER = createRequestTypes('REGISTER')
export const SELECT_PATIENT = createRequestTypes('SELECT_PATIENT')
export const CLEAR_SELECT_PATIENT = createRequestTypes('CLEAR_SELECT_PATIENT')
export const GET_PAIN_LOGS = createRequestTypes('GET_PAIN_LOGS')
export const GET_LATEST_PAIN_LOG = createRequestTypes('GET_LATEST_PAIN_LOG')
export const CREATE_PAIN_LOG = createRequestTypes('CREATE_PAIN_LOG')
export const SET_PAIN_LOG_PATIENT = createRequestTypes('SET_PAIN_LOG_PATIENT')
export const SET_PAIN_LOCATION = createRequestTypes('SET_PAIN_LOCATION')
export const SET_PAIN_HEAD_SITE = createRequestTypes('SET_PAIN_HEAD_SITE')
export const SET_PAIN_FREQUENCY = createRequestTypes('SET_PAIN_FREQUENCY')
export const SET_PAIN_TOTAL_TIME_MINUTE = createRequestTypes('SET_PAIN_TOTAL_TIME_MINUTE')
export const INIT_PAIN_DATA = createRequestTypes('INIT_PAIN_DATA')
export const GET_PAIN_LOG_OPTIONS = createRequestTypes('GET_PAIN_LOG_OPTIONS')
export const SET_PAIN_LOG_SELECT_OPTION = createRequestTypes('SET_PAIN_LOG_SELECT_OPTION')
export const CLEAR_PAIN_LOG_SELECT_OPTION = createRequestTypes('CLEAR_PAIN_LOG_SELECT_OPTION')
export const GET_PAINLOG_HEAD_MAP = createRequestTypes('GET_PAINLOG_HEAD_MAP')
export const GET_MY_CONSULTATIONS = createRequestTypes('GET_MY_CONSULTATIONS')
export const GET_RELATED_TAGS_BY_NAME = createRequestTypes('GET_RELATED_TAGS_BY_NAME')
export const SET_CURRENT_HISTORY_OPTIONS = createRequestTypes('SET_CURRENT_HISTORY_OPTIONS')
export const SYNC_MY_CONSULTATIONS_UNREAD = 'SYNC_MY_CONSULTATIONS_UNREAD'
export const GET_DEFAULT_PATIENT = createRequestTypes('GET_DEFAULT_PATIENT')
export const SET_EXTRA_SITES = createRequestTypes('SET_EXTRA_SITES')
export const CHANGE_SHOW_OPTIONS = createRequestTypes('CHANGE_SHOW_OPTIONS')
export const SET_CONSULTATION_REPORT_COUNT = createRequestTypes('SET_CONSULTATION_REPORT_COUNT')
export const SET_BODY_SITE = createRequestTypes('SET_BODY_SITE')
export const GET_PAIN_LOG_DETAIL = createRequestTypes('GET_PAIN_LOG_DETAIL')
export const SHOW_CREATE_LOG = createRequestTypes('SHOW_CREATE_LOG')

export default {
  dispatchSavePatient(payload) {
    return {
      type: SAVE_PATIENT.REQUEST,
      payload
    }
  },
  dispatchInitPainData() {
    return {
      type: INIT_PAIN_DATA.REQUEST,
    }
  },
  dispatchSetPainFrequency(count) {
    return {
      type: SET_PAIN_FREQUENCY.REQUEST,
      count
    }
  },
  dispatchSetPainTotalTimeMinute(time) {
    return {
      type: SET_PAIN_TOTAL_TIME_MINUTE.REQUEST,
      time
    }
  },
  dispatchCreatePainLog(payload, isPlanTask) {
    return {
      type: CREATE_PAIN_LOG.REQUEST,
      payload,
      isPlanTask,

    }
  },
  dispatchGetLatestPainLog(payload) {
    return {
      type: GET_LATEST_PAIN_LOG.REQUEST,
      payload
    }
  },
  dispatchGetPainLogHeadMap() {
    return {
      type: GET_PAINLOG_HEAD_MAP.REQUEST,
    }
  },
  dispatchGetPainLogOptions(payload) {
    return {
      type: GET_PAIN_LOG_OPTIONS.REQUEST,
      payload
    }
  },
  dispatchSetPainLogSelectOption(payload) {
    return {
      type: SET_PAIN_LOG_SELECT_OPTION.REQUEST,
      payload
    }
  },
  dispatchClearPainLogSelectOption() {
    return {
      type: CLEAR_PAIN_LOG_SELECT_OPTION.REQUEST,
    }
  },
  dispatchSetPainLocation(payload) {
    return {
      type: SET_PAIN_LOCATION.REQUEST,
      payload
    }
  },
  dispatchSetPainHeadSite(payload) {
    return {
      type: SET_PAIN_HEAD_SITE.REQUEST,
      payload
    }
  },
  dispatchGetMyPatients(payload = {}, callBack) {
    return {
      type: GET_MY_PATIENTS.REQUEST,
      payload,
      callBack
    }
  },
  dispatchGetMyPatientsAndRegistrationStatus(payload) {
    return {
      type: GET_MY_PATIENTS_AND_REGISTRATION_STATUS.REQUEST,
      payload
    }
  },
  dispatchGetPatientRelationship(payload) {
    return {
      type: GET_PATIENT_RELATIONSHIP.REQUEST,
      payload
    }
  },
  dispatchGetPatientById(payload) {
    return {
      type: GET_PATIENT_BY_ID.REQUEST,
      payload
    }
  },
  dispatchRegister(payload, complete, isElectronic) {
    return {
      type: REGISTER.REQUEST,
      payload,
      complete,
      isElectronic
    }
  },
  dispatchSelect(selectedPatient) {
    return {
      type: SELECT_PATIENT.REQUEST,
      selectedPatient
    }
  },
  dispatchClearSelect() {
    return {
      type: CLEAR_SELECT_PATIENT.REQUEST,
    }
  },
  dispatchGetPainLogs(payload) {
    return {
      type: GET_PAIN_LOGS.REQUEST,
      payload
    }
  },
  dispatchSetPainLogPatient(patient) {
    return {
      type: SET_PAIN_LOG_PATIENT.REQUEST,
      result: patient
    }
  },
  dispatchGetMyConsultations(payload) {
    return {
      type: GET_MY_CONSULTATIONS.REQUEST,
      payload
    }
  },
  dispatchGetRelatedTagsByName(payload) {
    return {
      type: GET_RELATED_TAGS_BY_NAME.REQUEST,
      payload
    }
  },
  dispatchSetCurrentHistoryOptions(payload) {
    return {
      type: SET_CURRENT_HISTORY_OPTIONS.REQUEST,
      payload
    }
  },
  dispatchGetDefaultPatient() {
    return {
      type: GET_DEFAULT_PATIENT.REQUEST,
    }
  },
  dispatchSetExtraSites(site) {
    return {
      type: SET_EXTRA_SITES.REQUEST,
      site,
    }
  },
  dispatchChangeShowOptions() {
    return {
      type: CHANGE_SHOW_OPTIONS.REQUEST,
    }
  },
  dispatchSetReportUnCount(unViewedCount, isReduced) {
    return {
      type: SET_CONSULTATION_REPORT_COUNT.REQUEST,
      unViewedCount,
      isReduced
    }
  },
  dispatchSetBodySite(data) {
    return {
      type: SET_BODY_SITE.REQUEST,
      data
    }
  },
  dispatchGetPainLogDetail(payload) {
    return {
      type: GET_PAIN_LOG_DETAIL.REQUEST,
      payload
    }
  },
  dispatchShowCreateLog(payload) {
    return {
      type: SHOW_CREATE_LOG.SUCCESS,
      payload
    }
  },
}
